#!/usr/bin/env python3

import os

print(os.path.relpath('.', '/home'))
print(os.path.dirname('/etc/apt/auth.conf.d'))#返回最后一个斜杠之前的所有内容
print(os.path.basename('/etc/apt/auth.conf.d'))#返回最后一个斜杠之后的所有内容
download = '/home/ziming/Downloads'
print(os.path.split(download))
print(download.split(os.path.sep))
totalSize = 0
for filename in os.listdir('.'): #os.listdir(path)列出目录下的文件
    totalSize = totalSize + os.path.getsize(os.path.join(os.getcwd(), filename)) #os.path.getsize()查看文件大小
print(totalSize)
